package com.demo.api.system.service;

import com.demo.api.system.factory.RemoteLogFallbackFactory;
import com.demo.common.core.constants.SecurityConstants;
import com.demo.common.core.constants.ServerNameConstants;
import com.demo.common.core.domain.SysLogininforBo;
import com.demo.common.core.domain.SysOperLogBo;
import com.demo.common.core.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 用户服务
 *
 * @author demo
 */
@Component
@FeignClient(contextId = "remoteLogService", value = ServerNameConstants.LOG_SERVER, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteLogService {

    @PostMapping("/log/logininfor")
    public R<Boolean> logininfor(@RequestBody SysLogininforBo logininforBo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @PostMapping("/log/operLocation")
    public R<Boolean> operLocation(@RequestBody SysOperLogBo operLogBo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
